package com.baizhi.mall.controller;

import com.baizhi.mall.util.ResultEntity;
import com.baizhi.mall.service.MenuService;
import com.baizhi.mall.entity.mysql.Menu;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("这个是菜单的接口，操作后台的左侧菜单")
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService ms;
    @GetMapping
    @ApiOperation("查询出一级菜单同时把一级菜单下面的二级菜单查询出来")
    public ResultEntity<List<Menu>> selectAll(){
        List<Menu> menus = ms.selectAll();
        return ResultEntity.ok(menus);
    }
}
